import React, { forwardRef, useImperativeHandle } from 'react';

// ref必须
const ForwordRef = (props: any, ref: any) => {
  useImperativeHandle(ref, () => ({
    getValues: () => {
      return 'hell word';
    },
  }));

  return (
    <>
      <p>我是子组件</p>
    </>
  );
};

export default forwardRef(ForwordRef);
